'use strict';

const Controller = require('egg').Controller;

class FootController extends Controller {
    async get() {
        const  ctx  = this.ctx;
        const result = await ctx.service.public.getall('table_foot',ctx.params.httpid)
        ctx.body = result;
      }
      async post() {
        const  ctx  = this.ctx;
        const result = await ctx.service.public.add('table_foot',ctx.query)
        ctx.body = result;
      }
      async put() {
        const  ctx  = this.ctx;
        const result = await ctx.service.public.update('table_foot',ctx.query)
        ctx.body = result;
      }
      async delete() {
        const  ctx  = this.ctx;
        const result = await ctx.service.public.delete('table_foot',ctx.query)
        ctx.body = result;
      }
      async getapi(){
        const  ctx  = this.ctx;
        let str = ctx.request.headers.origin
        const url = str.slice(str.lastIndexOf('/')+1)
        const uu = await ctx.service.public.geta('table_foot',url)
        ctx.body = uu;
      }
}

module.exports = FootController;
